package org.fing.edu.uy.esbadp.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PathEvaluate {

	public static String evaluatePath(String path){
		String pathResult = path;
		Pattern p = Pattern.compile("\\$\\{([\\w|\\.]*)\\}");
		Matcher m = p.matcher(pathResult);
		while (m.find()){
			pathResult = pathResult.replace(m.group(0), System.getProperty(m.group(1), ""));
		}
		return pathResult;
	}
	
}
